#include <stdio.h>
int main()
{
	int n;
	int i=1;
	int sum = 0;
	for (n = 1; n <= 3; n++)
	{
		i = i * n;
		sum = sum + i;
	}
	printf("%d", sum);
	return 0;
}